﻿using BookTheBook.Data.Model;
using BookTheBook.Data.NameDefinitions;
using FluentNHibernate.Mapping;

namespace BookTheBook.Data.Mappings
{
    public class RentDetailsMap : ClassMap<RentDetails>
    {
        public RentDetailsMap()
        {
            Table(TableNames.RentDetails);
            Id(x => x.Id).Column(ColumnNames.RentDetailsId);
            Map(x => x.RentDate).Column(ColumnNames.RentDate);
            HasOne(x => x.Copy).ForeignKey(ForeignKeyNames.RentDetailsToCopy).Cascade.None();
            References(x => x.User).Column(ColumnNames.UserId);
        }
    }
}
